<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<title>项目匹配客户</title>

<head th:replace="top::html">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

<body class="fixed hold-transition skin-blue">
    <div class="wrapper">
        <!-- Main Header -->
        <div th:replace="tophtml::html"></div>
        <div th:replace="left::html"></div>

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    <span>项目匹配客户</span>
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                    <li><a th:href="@{/index}"><i class="fa fa-dashboard"></i>用户中心</a></li>
                    <li><a th:href="@{/project/showQuery}"><i class="fa fa-dashboard"></i>项目管理</a></li>
                    <li><a href="">项目匹配客户</a></li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content container-fluid">
                <p style="color: red;" th:text="${searchEmpty}"></p>
                <form class="form-inline" th:action="@{/customer/searchMatchedCustomer}" method="get" id="from1">
                    <input type="hidden" name="pageNo" id="pageNo" />
                    <input type="hidden" name="projectId" th:value="${project.pid}" />
                    <input type="hidden" name="projectNumber" th:value="${project.projectNumber}" />
                    <input type="hidden" name="projectName" th:value="${project.projectName}" />
                    <div class="form-group">
                        <label style="margin-left: 1px;">所属领域</label>
                        <span th:each="rfd : ${researchFieldDictiontryList}">
                            <label style="font-weight: lighter;">
                                <input type="checkbox" name="researchField" th:value="${rfd.names}" th:text="${rfd.worth}"
                                    style="margin-left: 1px;" th:checked="${researchFieldArr != null ? #arrays.contains(researchFieldArr, rfd.names) : false}">
                            </label>
                        </span>
                    </div>
                    <br />
                    <div class="form-group">
                        <label style="margin-left: 1px;">客户名称</label>
                        <input type="text" class="form-control" name="customerName" th:value="${customer.customerName}" style="width: 180px;">
                    </div>
                    <div class="form-group">
                        <label style="margin-left: 15px;">客户Id</label>
                        <input type="text" class="form-control" th:if="${customer.customerNumber==null}" name="customerNumberId"
                            th:value="${customer.customerNumber}" style="width: 180px;">
                        <input type="text" class="form-control" th:if="${customer.customerNumber!=null}" name="customerNumberId"
                            th:value="'C'+${customer.customerNumber}">
                    </div>
                    <div class="form-group">
                        <label style="margin-left: 1px;">主要需求</label>
                        <input type="text" class="form-control" name="majorNeeds" th:value="${customer.majorNeeds}"
                            style="width: 180px;">
                    </div>
                    <br></br>
                    <div class="form-group">
                        <label style="margin-left: 1px;">客户类型</label>
                        <select name="customerType" class="form-control" style="width: 180px;">
                            <option th:value=null>-请选择-</option>
                            <option th:each="psd : ${customerTypeList}" th:value="${psd.pid}" th:selected="${customer.customerType eq psd.pid}"
                                th:text="${psd.worth}"></option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label style="margin-left: 1px;">客户性质</label>
                        <select name="customerNature" class="form-control" style="width:180px;">
                            <option th:value=null>-请选择-</option>
                            <option th:each="psd : ${customerNatureList}" th:value="${psd.pid}" th:selected="${customer.customerNature eq psd.pid}"
                                th:text="${psd.worth}"></option>
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary" style="margin-left: 40px;">搜索</button>
                    <button type="reset" style="margin-left: 40px;" class="btn btn-primary">重置</button>
                    <input type="button" class="btn btn-primary" value="返回" onclick="window.history.go(-1)" style="margin-left: 40px;">
                    <br />
                    <div>
                        <span class="from-group">
                            <label style="margin-left: 1px;">所属地区</label>
                            <label style="font-weight: lighter;">
	                            <input type="radio" name="domesticOrForeign" id="optionsRadios1" value="0" style="margin-left: 1px;"
	                                th:checked="${customer != null ? customer.domesticOrForeign == 0 : false}">国内
                            </label>
                            <label style="font-weight: lighter;">
	                            <input type="radio" name="domesticOrForeign" id="optionsRadios2" value="1" style="margin-left: 15px;"
	                                th:checked="${customer != null ? customer.domesticOrForeign == 1 : false}">国外
                            </label>
                        </span>
                        <span class="form-group form-country">
                            <label style="margin-left: 108px;">国家</label>
                            <select class="form-area" style="width: 180px;height: 35px;border-color: silver;">
                                <option value="-1">--选择国家--</option>
                                <option th:each="list:${countryDictiontryList}" th:value="${list.pid}" th:text="${list.worth}"
                                    th:selected="${list.pid eq country}"></option>
                            </select>
                        </span><br />
                        <span class="form-group form-area">
                            <label style="margin-left: 42px;">省</label>
                            <select class="form-control form-area" id="provinceId" style="width: 182px;">
                                <option th:value="-1">--选择省--</option>
                                <option th:each="list:${provinceDictiontryList}" th:selected="${list.names eq province}"
                                    th:value="${list.names}" th:text="${list.worth}">
                                </option>
                            </select>
                        </span>
                        <span class="form-group form-area">
                            <label style="margin-left: 42px;">市</label>
                            <select class="form-control form-area" id="cityId" style="width: 180px;">
                                <option th:value="-1">--选择市--</option>
                                <option th:each="cityList:${cityDictiontryList}" th:selected="${cityList.names eq city}"
                                    th:value="${cityList.names}" th:text="${cityList.worth}">--选择市--
                                </option>
                            </select>
                        </span>
                        <span class="form-group form-area">
                            <label style="margin-left: 48px;">区</label>
                            <select class="form-control form-area" id="areaId" style="width: 180px;">
                                <option th:value="-1">--选择区--</option>
                                <option th:each="arealist:${areaDictiontryList}" th:selected="${arealist.names eq district}"
                                    th:value="${arealist.names}" th:text="${arealist.worth}">--选择区--
                                </option>
                            </select>
                        </span>
                    </div>
                </form>

                <div class="box">
                    <!-- /.box-header -->
                    <button id="dosubmit" class="btn btn-primary">匹配</button>
                    <span style="margin-left: 50px;font-size: 16px;">
                        <b>项目名称:</b> 
                        <a th:href="@{'/project/showConditionQuery?searchKeyword=R'+${project.projectNumber}}" th:text="${project.projectName}">查看详情</a>
                    </span>
                    <div class="box-body">
                        <table class="table table-bordered">
                            <tbody>
                                <tr>
                                    <th>
                                        <input id="all" type="checkbox" th:disabled="${not #lists.isEmpty(buttedCustomerIdList)}" />
                                    </th>
                                    <th>客户名称</th>
                                    <th>客户ID</th>
                                    <th>客户性质</th>
                                    <th>主要需求</th>
                                    <th>所在地区</th>
                                    <th>所属领域</th>
                                    <th>当前合作状态</th>
                                </tr>
                                <tr th:each="customer,customerIndex :  ${pageInfo.list}" th:class="${#lists.contains(buttedCustomerIdList, customer.pid) ? 'butt-gray' : ''}">
                                    <td>
                                        <input type="checkbox" class="matched" th:disabled="${#lists.contains(buttedCustomerIdList, customer.pid)}"
                                            th:value="'customerId='+${customer.pid}+'&customerNumber='+${customer.customerNumber}+'&customerName='+${customer.customerName}+'&projectId='+${project.pid}+'&projectNumber='+${project.projectNumber}+'&projectName='+${project.projectName}" />
                                    </td>
                                    <td th:text="${customer.customerName}"></td>
                                    <td >
                                    
                                    <a th:href="@{'/customer/showDetail?customerId='+${customer.pid}}" th:text="'C'+${customer.customerNumber}"></a>
                                    
                                    </td>
                                    <td th:text="${customer.customerNatureName}"></td>
                                    <td th:text="${customer.majorNeeds}"></td>
                                    <td th:text="${customer.areaNameStr}"></td>
                                    <td th:text="${customer.ResearchFieldNameStr}"></td>
                                    <td th:text="${customer.currentStateName}"></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div th:replace="page::html"></div>
                </div>
            </section>
        </div>
        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>

    </div>
    <div th:replace="bottom::html"></div>
    <script type="text/javascript" th:inline="javascript">
        matchButt([[@{/customer/projectMatchCustomer}]]);
    </script>

</body>

</html>